package com.techtransteam.techtransteamWeb.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.techtransteam.techtransteamWeb.dal.dao.impl.RoleDAO;
import com.techtransteam.techtransteamWeb.dal.entities.Role;

@Service("RoleService")
@Transactional(readOnly = true)
public class RoleService {
	
	@Autowired
	RoleDAO roleDAO;
	
	public RoleDAO getRoleDAO() {
		return roleDAO;
	}

	public void setRoleDAO(RoleDAO roleDAO) {
		this.roleDAO = roleDAO;
	}

	@Transactional(readOnly = false)
    public void addRole(Role role) {
       roleDAO.addRole(role);
    }
	
	public List<Role> getAllRoles(){
		return roleDAO.getAllRoles();
	}

}
